import request from '@/utils/request'

// 获取 部门列表 /company/department
export function companyDepartmentRequest() {
  return request({
    url: '/api/company/department',
    method: 'GET'
  })
}

// 获取部门负责人列表 /sys/user/simple
export function getDepartmentRequest() {
  return request({
    url: '/api/sys/user/simple',
    method: 'GET'
  })
}

// 获取 新增-部门 /company/department (和获取部门列表的一样 就是请求方式不一样)
export function AddCompanyDepartmentRequest(data) {
  return request({
    url: '/api/company/department',
    method: 'POST',
    data
  })
}

// 获取 删除-部门详情 /company/department/{id}
export function DeleteDepartmentRequest(id) {
  return request({
    url: `/api/company/department/${id}`,
    method: 'DELETE'
  })
}

// 获取 修改-部门详情 /company/department/{id}
export function UpdateDepartmentRequest(data) {
  return request({
    url: `/api/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 获取 部门详情 /company/department/{id}
export function getCompanyDepartmentRequest(id) {
  return request({
    url: `/api/company/department/${id}`,
    method: 'GET'
  })
}
